package com.woniu.woniuproject.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.woniuproject.entity.Debtor_record;
import com.woniu.woniuproject.mapper.Debtor_recordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class Debtor_recordService {
    @Autowired
    Debtor_recordMapper debtorRecordMapper;

    public int insert(Debtor_record debtorrecord) {
        return debtorRecordMapper.insert(debtorrecord);
    }


    public PageInfo<Debtor_record> selectApplyList(int currentPage, int pageSize, Date start, Date end) {
        PageHelper.startPage(currentPage,pageSize);
        List<Debtor_record> list = debtorRecordMapper.selectApplyList(start,end);
        PageInfo<Debtor_record> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
    public int updaterecord(int id) {
        return debtorRecordMapper.updaterecord(id);
    }

    public int deleterecord() {
        return debtorRecordMapper.deleterecord();
    }
}
